import request from '@/utils/request'

// 投诉反馈统计表
export function getFeedback(startTime, endTime) {
	return request({
		url: `/complaint/ledger/getFeedback?startTime=${startTime}&endTime=${endTime}`,
		method: 'get'
	})
}

// 产品问题明细表
export function getGoodsProblem(startTime, endTime) {
	return request({
		url: `/complaint/ledger/getGoodsProblem?startTime=${startTime}&endTime=${endTime}`,
		method: 'get'
	})
}

// 产品
export function getComplaintGoodsList(){
	return request({
		url: `/app/complaint/order/getComplaintGoodsList`,
		method: 'get'
	})
}

// 产品
export function getGoodsComplaintType(){
	return request({
		url: `/app/complaint/order/getGoodsComplaintType`,
		method: 'get'
	})
}

// 查询客诉订单列表
export function listOrder(query) {
	return request({
		url: '/complaint/order/list',
		method: 'get',
		params: query
	})
}

// 查询客诉订单详细
export function getOrder(id) {
	return request({
		url: '/complaint/order/' + id,
		method: 'get'
	})
}

// 新增客诉订单
export function addOrder(data) {
	return request({
		url: '/complaint/order',
		method: 'post',
		data: data
	})
}

// 修改客诉订单
export function updateOrder(data) {
	return request({
		url: '/complaint/order',
		method: 'put',
		data: data
	})
}

// 删除客诉订单
export function delOrder(id) {
	return request({
		url: '/complaint/order/' + id,
		method: 'delete'
	})
}